﻿Public Class ReportUT505
	Inherits System.Web.UI.Page

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		If Not Page.IsPostBack Then
			BL.Report.SetMonthList(Me.ddlMonth)
			BL.Report.SetYearList(Me.ddlYear)
		End If
	End Sub

	Protected Sub btnPDF_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPDF.Click
		If String.IsNullOrEmpty(Me.ucPopupOfficer1.OfficerAppId) Then
			Me.Master.Alert("กรุณาระบุนักธุรกิจทีท่านต้องการออกรายงาน")
			Exit Sub
		End If
		Dim lstParam As New List(Of String)
		lstParam.Add(Me.ucPopupOfficer1.OfficerAppId)
		lstParam.Add(Me.ucPopupOfficer1.OfficerName)
		Me.Session("reportparameter") = lstParam

		Me.ClientScript.RegisterClientScriptBlock(Me.GetType, "ut505", "window.open('report/exportpdf.aspx?rptname=ut505', 'exportpdf','')", True)
		Me.Session("reportdatasource") = BL.Report.ReportUT505(Me.ddlMonth.SelectedValue, Me.ddlYear.SelectedValue, Me.ucPopupOfficer1.OfficerId)
	End Sub
End Class